﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DMHelper.Models
{
    public class ACCContainer
    {
        public AdditionNumericalField TotalAC = new AdditionNumericalField();
        public AdditionNumericalField TouchAC = new AdditionNumericalField();
        public AdditionNumericalField FlatFootAC = new AdditionNumericalField();

        public NumericalField BaseAC = new NumericalField(10);
        public ReferenceNumericalField RefArmorBonus = new ReferenceNumericalField(new NumericalField());
        public ReferenceNumericalField RefShieldBonus = new ReferenceNumericalField(new NumericalField());

        private ReferenceNumericalField _DexBonus = new ReferenceNumericalField(new NumericalField());
        public ReferenceNumericalField DexBonus
        {
            get { return _DexBonus; }
            set { _DexBonus = value; }
        }

        public AdditionNumericalField armorPenalty = new AdditionNumericalField();

        public NumericalField SizeModifier = new NumericalField();
        public NumericalField NaturalArmorModifier = new NumericalField();
        public NumericalField DeflectionModifier = new NumericalField();
        public NumericalField MiscModifier = new NumericalField();

        /** Shield And Armor **/

        public StringField ArmorName = new StringField();
        public NumericalField ArmorMaxDex = new NumericalField();
        public NumericalField ArmorBonus = new NumericalField();
        public NumericalField ArmorCheckPenalty = new NumericalField();
        public NumericalField ArmorWeight = new NumericalField();

        public StringField ShieldName = new StringField();
        public NumericalField ShieldMaxDex = new NumericalField();
        public NumericalField ShieldBonus = new NumericalField();
        public NumericalField ShieldCheckPenalty = new NumericalField();
        public NumericalField ShieldWeight = new NumericalField();
        
        /** end shield and armor **/

        public ACCContainer()
        {
            RefArmorBonus = new ReferenceNumericalField(ArmorBonus);
            RefShieldBonus = new ReferenceNumericalField(ShieldBonus);

            armorPenalty.listeModifier.Add(ArmorCheckPenalty);
            armorPenalty.listeModifier.Add(ShieldCheckPenalty);

            TotalAC.listeModifier.Add(BaseAC);
            TotalAC.listeModifier.Add(RefArmorBonus);
            TotalAC.listeModifier.Add(RefShieldBonus);
            TotalAC.listeModifier.Add(DexBonus);
            TotalAC.listeModifier.Add(SizeModifier);
            TotalAC.listeModifier.Add(NaturalArmorModifier);
            TotalAC.listeModifier.Add(DeflectionModifier);
            TotalAC.listeModifier.Add(MiscModifier);

            TouchAC.listeModifier.Add(BaseAC);
            TouchAC.listeModifier.Add(DexBonus);
            TouchAC.listeModifier.Add(SizeModifier);
            TouchAC.listeModifier.Add(DeflectionModifier);

            FlatFootAC.listeModifier.Add(BaseAC);
            FlatFootAC.listeModifier.Add(RefArmorBonus);
            FlatFootAC.listeModifier.Add(RefShieldBonus);
            FlatFootAC.listeModifier.Add(NaturalArmorModifier);
        }
    }
}